import { getAction,deleteAction,putAction,postAction} from '@/api/manage'


//权限管理
const addPermission= (params)=>postAction("/online/api/createSysSecurityPermission",params);
const editPermission= (params)=>postAction("/online/api/updateSysSecurityPermission",params);
const getSystemMenuList = (params)=>getAction("/online/api/getSystemMenuList",params);
const getSystemSubmenu = (params)=>getAction("/online/api/getSystemSubmenu",params);
const getSystemSubmenuBatch = (params) => getAction('/online/api/getSystemSubmenuBatch', params)

const queryTreeList = (params)=>getAction("/online/api/queryTreeList",params);

const queryPermissionsByUser = (params)=>getAction("/online/api/getUserPermissionByToken",params);  //test
const getPermissionRuleList = (params)=>getAction("/online/api/getPermRuleListByPermId",params);
const queryPermissionRule = (params)=>getAction("/online/api/queryPermissionRule",params);

// 
const frozenBatch = (params)=>getAction("/online/api/frozenBatch",params);
const getUserList = (params)=>getAction("/online/api/getUserList",params);
const queryDepartTreeList = (params)=>getAction("/online/api/queryTreeList",params);
const queryIdTree = (params)=>getAction("/online/api/queryIdTree",params);
const searchByKeywords   = (params)=>getAction("/online/api/searchBy",params);

//字典标签专用（通过code获取字典数组）
export const ajaxGetDictItems = (code, params)=>getAction(`/online/dict/getDictItems/${code}`,params);

//获取系统访问量
const getLoginfo = (params)=>getAction("/mock/loginfo",params);	//test
const getVisitInfo = (params)=>getAction("/mock/visitInfo",params);	//test

// 根据部门主键查询用户信息
const queryUserByDepId = (params)=>getAction("/online/api/queryUserByDepId",params);
// 重复校验
const duplicateCheck = (params)=>getAction("/online/duplicate/check",params);
// 加载分类字典
const loadCategoryData = (params)=>getAction("/online/category/loadAllData",params);
const checkRuleByCode = (params) => getAction('/online/checkRule/checkByCode', params)

// ---------------------------新增分界线---------------------------------
const listSysAllSecurityPermission = (params)=>getAction("/online/api/listSysAllSecurityPermission",params);
const listSysSecurityPermissionBySecurityGroup = (params)=>getAction("/online/api/listSysSecurityPermissionBySecurityGroup",params);
const saveSysSecurityPermissionToSecurityGroup = (params)=>getAction("/online/api/saveSysSecurityPermissionToSecurityGroup",params);
const listSysSecurityGroup = (params)=>getAction("/online/api/listSysSecurityGroup",params);
const listSysSecurityGroupByUserId = (params)=>getAction("/online/api/listSysSecurityGroupByUserId",params);
const saveSysSecurityGroupToUser = (params)=>getAction("/online/api/saveSysSecurityGroupToUser",params);

const createSysUser = (params)=>getAction("/online/api/createSysUser",params);
const updateSysUser = (params)=>getAction("/online/api/updateSysUser",params);
const updatePasswordForPartyId = (params)=>getAction("/online/api/updatePasswordForPartyId",params);
const createSysSecurityGroup = (params)=>getAction("/online/api/createSysSecurityGroup",params);
const updateSysSecurityGroup = (params)=>getAction("/online/api/updateSysSecurityGroup",params);
const removeSysSecurityGroup = (params)=>getAction("/online/api/removeSysSecurityGroup",params);
const selectAllCompanyTree = (params)=>getAction("/online/api/selectAllCompanyTree",params);

// 部门管理
const queryDepartTreeList2 = (params)=>getAction("/online/api/getEcPartyGroupLazy",params);


//查询人员列表
export {
  addPermission,
  editPermission,
  queryTreeList,
  queryPermissionsByUser,
  getPermissionRuleList,
  queryPermissionRule,
  queryDepartTreeList,
  queryIdTree,
  searchByKeywords,
  getLoginfo,
  getVisitInfo,
  queryUserByDepId,
  duplicateCheck,
  getSystemMenuList,
  getSystemSubmenu,
  getSystemSubmenuBatch,
  loadCategoryData,
  checkRuleByCode,

  listSysAllSecurityPermission,
  listSysSecurityPermissionBySecurityGroup,
  saveSysSecurityPermissionToSecurityGroup,
  createSysUser,
  updateSysUser,
  updatePasswordForPartyId,
  createSysSecurityGroup,
  updateSysSecurityGroup,
  removeSysSecurityGroup,
  listSysSecurityGroup,
  listSysSecurityGroupByUserId,
  saveSysSecurityGroupToUser,
  selectAllCompanyTree,
  queryDepartTreeList2,
  frozenBatch,
  getUserList
}

